﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using QuanLyShopThoiTrang.QuanLyShopThoiTrang_BUS_WS;

namespace QuanLyShopThoiTrang
{
    public partial class ThayDoiThongTinNhaCungCap : Form
    {
        QuanLyNhaCungCap qlncc;
        NhaCungCap ncc = new NhaCungCap();
        public ThayDoiThongTinNhaCungCap()
        {
            InitializeComponent();
        }

        public void Set(QuanLyNhaCungCap nc, NhaCungCap n)
        {
            qlncc = nc;
            ncc = n;

            textBox1.Text = ncc.NhaCungCap_Ten;
            textBox2.Text = ncc.NhaCungCap_DiaChi;
            textBox3.Text = ncc.NhaCungCap_Email;
            textBox4.Text = ncc.NhaCungCap_SoDienThoai;
            textBox5.Text = ncc.NhaCungCap_Website;
        }

        private void ThayDoiThongTinNhaCungCap_Load(object sender, EventArgs e)
        {

        }

        private void button1_Click(object sender, EventArgs e)
        {
            ncc.NhaCungCap_Ten = textBox1.Text;
            ncc.NhaCungCap_SoDienThoai = textBox4.Text;
            ncc.NhaCungCap_DiaChi = textBox2.Text;
            ncc.NhaCungCap_Website = textBox5.Text;
            ncc.NhaCungCap_Email = textBox3.Text;

            qlncc.Set(ncc);

            Close();
        }
    }
}
